package com.zyh.demo;

public class ExceptionDemo4 {
    public static void main(String[] args) {
        try {
            throw new MyException("1233");
        } catch (MyException e) {
            System.out.println("998797");
        } finally {
            System.out.println("11111");
        }
    }

    public static void main1(String[] args) {
        try {
            int a = 10;
            throw new MyRuntimeException("运行时异常");
        } catch (MyRuntimeException e) {
            System.out.println("异常解决");
        } finally {
            System.out.println("finally");
        }
    }
}

class MyException extends Exception {
    public MyException() {
    }

    public MyException(String message) {
        super(message);
    }
}

class MyRuntimeException extends RuntimeException {
    public MyRuntimeException() {
    }

    public MyRuntimeException(String message) {
        super(message);
    }
}
